package com.lanp.springes.model.es;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Document(indexName = "test_product", createIndex = true)
public class ProductEs {
    @Id
    private Integer productId;
    @Field(type = FieldType.Text)
    private String productName;
    @Field(type = FieldType.Long)
    private Long cateId;
    @Field(type = FieldType.Double)
    private BigDecimal price;

    private Date createTime;
    @Field(type = FieldType.Nested)
    private List<SkuEs> skus;


    public Integer getProductId() {
        return productId;
    }

    public void setProductId(Integer productId) {
        this.productId = productId;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public Long getCateId() {
        return cateId;
    }

    public void setCateId(Long cateId) {
        this.cateId = cateId;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public List<SkuEs> getSkus() {
        return skus;
    }

    public void setSkus(List<SkuEs> skus) {
        this.skus = skus;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
}
